package com.xz.controller;

import com.xz.arzon.bean.Actress;
import com.xz.arzon.bean.Arzon;
import com.xz.arzon.service.ArzonService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;

import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.Produces;
import javax.ws.rs.QueryParam;
import javax.ws.rs.core.MediaType;
import java.util.List;

/**
 * Created by YLZX-Z0107 on 2014/7/24.
 */
@Controller
@Path("/")
@Produces(MediaType.APPLICATION_JSON)
public class ArzonController {
    @Autowired
    ArzonService arzonService;

    @GET
    @Path("basic")
    public Arzon getArzon(@QueryParam("id") int id) {
        Arzon arzon = new Arzon();
        arzon.setTitle("java后端搞js不行啊");
        arzon.setFactory("yolu.com");
        arzon.setSeries("papafirst");
        arzon.setFan("123");
        arzon.setCover("C:\\Users\\YLZX-Z0107\\Pictures\\9213b07eca80653855ab9c9195dda144ac3482ea.jpg");
        return arzon;
    }

    @GET
    @Path("item-name-list")
    public List<Arzon> getArzonBasic(@QueryParam("name") String name){
        return arzonService.listArzonBasicByAcress(name);
    }

    @GET
    @Path("item-list")
    public List<Arzon> getArzonBasic(@QueryParam("page") int page, @QueryParam("pageSize") int pageSize){
        return arzonService.listArzonBasic(page,pageSize);
    }
}
